diff --git a/ChangeLog b/ChangeLog
index def8f38600b37b33982dd169f1514ee7e7d42d93..41eb5531f8bf9ad1ad5f7aa7dc94ac5801437ca9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -66,6 +66,7 @@ CVS code -
 	- corrected the Mouse Toggle section, noticed by Daniel Bonniot.
 - rcfile.c:
 	- NUM_RCOPTS fix (DLR).
+	- Add tabsize support to rc file (Nathan Heagy).
 - search.c:
 	- Changed search prompt to "Search" followed by a list of
 	  bracketed, free-standing modifiers that do not imply a grammar,
diff --git a/nanorc.sample b/nanorc.sample
index 683fe83bab1965e110d7d5b6f1121642424c77c8..3fd1d49eb960ea35b95013b8e37c27fab82c0e6d 100644
--- a/nanorc.sample
+++ b/nanorc.sample
@@ -26,6 +26,9 @@
 # Use this value instead of the default
 # set fill -8
 
+# Use this tab size instead of the default
+# set tabsize 8
+
 # Use this spelling checker instead of the default one
 # set speller aspell
 
diff --git a/rcfile.c b/rcfile.c
index d723d72bdfe6e6abbfae47ceab3b94598d0268e1..622760ac874a6e0e3bb346e01e055b166c604c8e 100644
--- a/rcfile.c
+++ b/rcfile.c
@@ -39,7 +39,7 @@
 #define _(string) (string)
 #endif
 
-#define NUM_RCOPTS 17
+#define NUM_RCOPTS 18
 /* Static stuff for the nanorc file */
 rcoption rcopts[NUM_RCOPTS] = 
 {
@@ -51,6 +51,7 @@ rcoption rcopts[NUM_RCOPTS] =
 {"mouse", USE_MOUSE},
 {"operatingdir", 0},
 {"pico", PICO_MODE},
+{"tabsize", 0},
 
 #ifndef DISABLE_WRAPJUSTIFY
 {"fill", 0},
@@ -169,6 +170,7 @@ void parse_rcfile(FILE *rcstream, char *filename)
 		    if (set == 1 || rcopts[i].flag == FOLLOW_SYMLINKS) {
 			if (
 			    !strcasecmp(rcopts[i].name, "operatingdir") ||
+			    !strcasecmp(rcopts[i].name, "tabsize") ||
 #ifndef DISABLE_WRAPJUSTIFY
 			    !strcasecmp(rcopts[i].name, "fill") || 
 #endif
@@ -197,8 +199,15 @@ void parse_rcfile(FILE *rcstream, char *filename)
 				else
 				     fill = i;
 #endif
-			    } 
-			    else {
+			    } else if (!strcasecmp(rcopts[i].name, "tabsize")) {
+			    	if ((i = atoi(option)) <= 0) {
+			    		rcfile_msg(&errors,
+			    			_("Error in %s on line %d: requested tab size %d too small"),
+			    				filename, lineno, option);
+			    	} else {
+			    		tabsize = i;
+			    	}
+			    } else {
 #ifndef DISABLE_SPELLER
 				alt_speller = charalloc(strlen(option) + 1);
             			strcpy(alt_speller, option);